﻿
using System;
using System.Collections.Generic;
using System.Text;

using YouHP.Utility;
using YouHP.BLL;
using YouHP.Model;

namespace YouHP.Pages.IndicatorHistory
{
    public class Index : YouHP.Pages.PatientBasePage
    {
        private const int IndicatorBaseHeight = 110;
        private const int IndicatorYGap = 30;
        protected int IndicatorGraphHeight = IndicatorBaseHeight + IndicatorYGap;

        protected override void ShowPage()
        {
            base.ShowPage();
            if (ErrorCount > 0) return;

            HandleCommon();
            if (ErrorCount > 0) return;

            if (IsPost) HandlePost();
            else HandleGet();
        }

        protected List<IndicatorHistoryInfo> CurrentIndicatorList;

        protected new void HandleCommon()
        {
            this.AddLocation("实验室指标记录", "/IndicatorHistory/Index.aspx");
            this.SetTitle("实验室指标记录");
        }

        protected new void HandlePost()
        {

        }

        protected new void HandleGet()
        {
            CurrentIndicatorList = PatientIndicatorBLL.Instance.GetCurrentIndicatorList(PrData.Id);

            //利用实验室指标个数来计算flash高度
            if (CurrentIndicatorList != null)
            {
                IndicatorGraphHeight += (CurrentIndicatorList.Count) * IndicatorYGap;
            }
        }


    }
}